<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import servicePrice from '@/api/logistics/servicePrice'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'service_price',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'drawer',
    width: 600
  },
  api: servicePrice.getList,
  add: {
    show: true,
    api: servicePrice.save,
    auth: ['logistics:servicePrice:save']
  },
  edit: {
    show: true,
    api: servicePrice.update,
    auth: ['logistics:servicePrice:update']
  },
  delete: {
    show: true,
    api: servicePrice.deletes,
    auth: ['logistics:servicePrice:delete']
  },
  import: {
    show: true,
    url: 'logistics/servicePrice/import',
    templateUrl: 'logistics/servicePrice/downloadTemplate',
    auth: ['logistics:servicePrice:import']
  }
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入主键"
    }
  },
  {
    title: "服务id",
    dataIndex: "service_id",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入服务id"
    }
  },
  {
    title: "报价",
    dataIndex: "price",
    formType: "input",
    search: true
  },
  {
    title: "目的地类型",
    dataIndex: "destination_type",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "单位",
    dataIndex: "unit",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "重量取值最小",
    dataIndex: "min_value",
    formType: "input",
    search: true
  },
  {
    title: "重量取值最大",
    dataIndex: "max_value",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "生效起始时间",
    dataIndex: "valid_start",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "生效结束时间",
    dataIndex: "valid_end",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "目的地",
    dataIndex: "destination",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "创建者",
    dataIndex: "created_by",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "更新者",
    dataIndex: "updated_by",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "删除时间",
    dataIndex: "deleted_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "备注",
    dataIndex: "remark",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  }
])
</script>
<script> export default { name: 'logistics:servicePrice' } </script>